/*
 * Wire
 * Copyright (C) 2018 Wire Swiss GmbH
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

@keyframes anim {
  from {
    transform: translateX(~'calc(-100% - 32px)');
  }
  to {
    transform: translateX(0);
  }
}

.warning {
  position: absolute;
  width: 100%;
  z-index: @z-index-warnings;

  &.warning-dimmed {
    height: 100%;
    background-color: fade(#000, 64%);
  }
}

.warning-bar {
  color: #fff;
  display: flex;
  justify-content: center;
  position: absolute;
  width: 100%;
}

.warning-bar-feature {
  height: @warning-bar-feature-height;
}

.warning-bar-connection {
  .label-xs;
  height: @warning-bar-connection-height;
  justify-content: center;
}

.warning-bar-click {
  cursor: pointer;
}

.warning-bar-progress {
  background-color: @w-yellow;
  animation: anim 2.1s @ease-in-out-quart infinite;
  position: absolute;
  width: 100%;
  height: 4px;

  &::after {
    background-color: @w-yellow;
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    transform: translateX(~'calc(100% + 32px)');
  }
}

.warning-bar-message {
  display: flex;
  align-items: center;
}

.warning-bar-spinner {
  margin-bottom: 1px;
  margin-left: 8px;
}

.warning-bar-close {
  position: absolute;
  right: 24px;
  top: 50%;
  margin-top: -@button-medium-sm-height / 2;
}

.warning-bar-icon {
  font-size: @icon-size-md;
  margin-right: 8px;
}

.warning-bar-link {
  cursor: pointer;

  &,
  &:hover,
  &:active {
    color: #fff;
    text-decoration: underline;
  }
}
